(() => {

    'use strict';
    goog.provide('Blockly.Blocks.ruilong');
    goog.require('Blockly.Blocks');
    goog.require('path');

    const mediaDirPath = path.join(document.currentScript.src, '../../media/');

    Blockly.Msg['RUILONG_HUE'] = 120;


    //LCD1602显示模块
    Blockly.Blocks.ruilong_LCD1602_Print = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendValueInput("TEXT", String).setCheck([String, Number]).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_DF_LCD).appendField(new Blockly.FieldTextInput('mylcd'), 'VAR').appendField(Blockly.Msg.MIXLY_LCD_PRINT1);
            this.appendValueInput("TEXT2", String).setCheck([String, Number]).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_LCD_PRINT2);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };

    Blockly.Blocks.ruilong_LCD1602_Print2 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendValueInput("row", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_DF_LCD).appendField(new Blockly.FieldTextInput('mylcd'), 'VAR').appendField(Blockly.Msg.MIXLY_LCD_ROW);
            this.appendValueInput("column", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_LCD_COLUMN);
            this.appendValueInput("TEXT", String).setCheck([String, Number]).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_LCD_PRINT);
            this.setPreviousStatement(true, null);
            this.setInputsInline(true);
            this.setNextStatement(true, null);
        }
    };

    Blockly.Blocks.ruilong_LCD1602_Power = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField(Blockly.Msg.MIXLY_DF_LCD).appendField(new Blockly.FieldTextInput('mylcd'), 'VAR')
                .appendField(new Blockly.FieldDropdown([[Blockly.Msg.MIXLY_LCD_STAT_ON, "display"], [Blockly.Msg.MIXLY_LCD_STAT_OFF, "noDisplay"], [Blockly.Msg.MIXLY_LCD_STAT_CURSOR, "cursor"], [Blockly.Msg.MIXLY_LCD_STAT_NOCURSOR, "noCursor"], [Blockly.Msg.MIXLY_LCD_STAT_CLEAR, "clear"], [Blockly.Msg.MIXLY_LCD_NOBACKLIGHT, "noBacklight"], [Blockly.Msg.MIXLY_LCD_BACKLIGHT, "backlight"]]), "STAT");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };

    //RGB彩灯显示模块  初始化
    Blockly.Blocks.ruilong_rgb_init = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_RGB_COUNT);
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setTooltip('');
        }
    };
    //RGB亮度调节
    Blockly.Blocks.ruilong_rgb_brightness = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("NUM").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField("亮度");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setTooltip('');
        }
    };
    //RGB彩灯单独像素点设置
    Blockly.Blocks.ruilong_rgb = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("_LED_").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_RGB_NUM);
            this.appendValueInput("RVALUE").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_RGB_R);
            this.appendValueInput("GVALUE").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_RGB_G);
            this.appendValueInput("BVALUE").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_RGB_B);
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setTooltip('');
        }
    };
    //RGB彩灯  选色块  设置颜色
    Blockly.Blocks.ruilong_rgb2 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("_LED_").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_RGB_NUM);
            this.appendDummyInput("").setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldColour("#ff0000"), "RGB_LED_COLOR");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };
    //RGB彩灯  七彩变换切换
    Blockly.Blocks.ruilong_rgb3 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("NUM").setCheck(Number).appendField("初始亮度");
            this.appendValueInput("WAIT").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField("七彩变换切换时间");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };
    //RGB彩灯 七彩循环切换
    Blockly.Blocks.ruilong_rgb4 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("NUM").setCheck(Number).appendField("初始亮度");
            this.appendValueInput("WAIT").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField("七彩循环切换时间");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };
    //RGB彩灯  点阵显示
    Blockly.Blocks.ruilong_display_Matrix_DisplayChar = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_LEFT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("NUM").setCheck(Number).setAlign(Blockly.ALIGN_LEFT).appendField("初始亮度");
            this.appendValueInput("RGBArray").setAlign(Blockly.ALIGN_LEFT).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_PICARRAY);

            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setInputsInline(true);
            this.setTooltip();
        }
    };
    //RGB彩灯  点阵清屏
    Blockly.Blocks.ruilong_display_Matrix_CLEAR = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendDummyInput("").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_CLEAR);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip();
        }
    };
    //RGB彩灯  点阵数组
    Blockly.Blocks.ruilong_display_Matrix_LedArray = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_ARRAYVAR).appendField(new Blockly.FieldTextInput("RGBArray1"), "VAR");
            this.appendDummyInput("").appendField(new Blockly.FieldColour("#ff0000"), "RGB_15").appendField(new Blockly.FieldColour("#ffffff"), "RGB_14").appendField(new Blockly.FieldColour("#ff0000"), "RGB_13").appendField(new Blockly.FieldColour("#ffffff"), "RGB_12").appendField(new Blockly.FieldColour("#ff0000"), "RGB_11");
            this.appendDummyInput("").appendField(new Blockly.FieldColour("#ffffff"), "RGB_25").appendField(new Blockly.FieldColour("#ffffff"), "RGB_24").appendField(new Blockly.FieldColour("#ffffff"), "RGB_23").appendField(new Blockly.FieldColour("#ffffff"), "RGB_22").appendField(new Blockly.FieldColour("#ffffff"), "RGB_21");
            this.appendDummyInput("").appendField(new Blockly.FieldColour("#ffffff"), "RGB_35").appendField(new Blockly.FieldColour("#ffffff"), "RGB_34").appendField(new Blockly.FieldColour("#ffffff"), "RGB_33").appendField(new Blockly.FieldColour("#ffffff"), "RGB_32").appendField(new Blockly.FieldColour("#ffffff"), "RGB_31");
            this.appendDummyInput("").appendField(new Blockly.FieldColour("#ff0000"), "RGB_45").appendField(new Blockly.FieldColour("#ffffff"), "RGB_44").appendField(new Blockly.FieldColour("#ffffff"), "RGB_43").appendField(new Blockly.FieldColour("#ffffff"), "RGB_42").appendField(new Blockly.FieldColour("#ff0000"), "RGB_41");
            this.appendDummyInput("").appendField(new Blockly.FieldColour("#ff0000"), "RGB_55").appendField(new Blockly.FieldColour("#ff0000"), "RGB_54").appendField(new Blockly.FieldColour("#ffffff"), "RGB_53").appendField(new Blockly.FieldColour("#ff0000"), "RGB_52").appendField(new Blockly.FieldColour("#ff0000"), "RGB_51");
            this.setOutput(true, Number);
            this.setTooltip();
        }
    };
    Blockly.Blocks.ruilong_display_Matrix_DisplayLedBar = Blockly.Blocks.ruilong_display_Matrix_DisplayChar;

    //RGB彩灯  灯条
    Blockly.Blocks.ruilong_display_Matrix_LedBar = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_ARRAYVAR).appendField(new Blockly.FieldTextInput("RGBBar1"), "VAR");
            this.appendDummyInput("").appendField(new Blockly.FieldColour("#ffffff"), "RGB_5").appendField(new Blockly.FieldColour("#ffffff"), "RGB_4").appendField(new Blockly.FieldColour("#ffffff"), "RGB_3").appendField(new Blockly.FieldColour("#ffffff"), "RGB_2").appendField(new Blockly.FieldColour("#ffffff"), "RGB_1");
            this.setInputsInline(true);
            this.setOutput(true, Number);
            this.setTooltip();
        }
    };

    Blockly.Blocks.ruilong_display_Matrix_DisplayChar2 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_RGB)
            this.appendValueInput("PIN", Number).setCheck(Number).setAlign(Blockly.ALIGN_LEFT).appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("NUM").setCheck(Number).setAlign(Blockly.ALIGN_LEFT).appendField("初始亮度");
            this.appendDummyInput("").setAlign(Blockly.ALIGN_LEFT).appendField("颜色").appendField(new Blockly.FieldColour("#ff0000"), "RGB_DOT_COLOR");
            this.appendValueInput("RGBArray_dot").setAlign(Blockly.ALIGN_LEFT).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_PICARRAY);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);

            //this.setTooltip();
        }
    };

    Blockly.Blocks.ruilong_display_Matrix_LedArray2 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_ARRAYVAR).appendField(new Blockly.FieldTextInput("RGBArray2"), "VAR");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_15").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_14").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_13").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_12").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_11");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_25").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_24").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_23").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_22").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_21");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_35").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_34").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_33").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_32").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_31");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_45").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_44").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_43").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_42").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_41");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_55").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_54").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_53").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_52").appendField(new Blockly.FieldCheckbox("FALSE"), "DOT_51");
            this.setOutput(true, Number);
            //this.setTooltip();
        }
    };
    Blockly.Blocks.ruilong_display_Matrix_DisplayBar2 = Blockly.Blocks.ruilong_display_Matrix_DisplayChar2;

    Blockly.Blocks.ruilong_display_Matrix_LedBar2 = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_ARRAYVAR).appendField(new Blockly.FieldTextInput("RGBArray2"), "VAR");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_5").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_4").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_3").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_2").appendField(new Blockly.FieldCheckbox("TRUE"), "DOT_1");
            this.setOutput(true, Number);
            //this.setTooltip();
        }
    };

    Blockly.Blocks.ruilong_tm1650_power = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField("TM1650四位数码管").appendField(new Blockly.FieldDropdown([[Blockly.Msg.MIXLY_LCD_STAT_ON, "displayOn"], [Blockly.Msg.MIXLY_LCD_STAT_OFF, "displayOff"], [Blockly.Msg.MIXLY_LCD_STAT_CLEAR, "clear"]]), "STAT");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };

    Blockly.Blocks.ruilong_tm1650_displayString = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField("TM1650四位数码管");
            this.appendValueInput("VALUE").setAlign(Blockly.ALIGN_RIGHT).appendField("显示字符串");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };

    Blockly.Blocks.ruilong_tm1650_showDot = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField("TM1650四位数码管")
                .appendField("第")
                .appendField(new Blockly.FieldDropdown([["1", "0"], ["2", "1"], ["3", "2"], ["4", "3"]]), "NO")
                .appendField("个")
                .appendField("小数点")
                .appendField(new Blockly.FieldDropdown([[Blockly.Msg.MIXLY_4DIGITDISPLAY_ON, "true"], [Blockly.Msg.MIXLY_4DIGITDISPLAY_OFF, "false"]]), "STAT");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
        }
    };

    //显示-TM1637初始化
    Blockly.Blocks.ruilong_tm1637_init = {
        init: function () {
            this.appendDummyInput().appendField("TM1637四位数码管");
            this.appendValueInput("PIN2").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField("DIO").appendField(Blockly.Msg.MIXLY_PIN);
            this.appendValueInput("PIN1").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField("CLK").appendField(Blockly.Msg.MIXLY_PIN);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.setInputsInline(true);
            this.setTooltip("");
            this.setHelpUrl("");
        }
    };

    //显示-TM1637-4位数码管显示字符串
    Blockly.Blocks.ruilong_tm1637_displayString = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField("TM1637四位数码管");
            this.appendDummyInput().appendField("显示字符串");
            this.appendValueInput("VALUE").setCheck(String).setAlign(Blockly.ALIGN_RIGHT);
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setTooltip("");
        }
    };

    //显示-TM1637-4位数码管显示时间
    Blockly.Blocks.ruilong_tm1637_displayTime = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField("TM1637四位数码管");
            this.appendDummyInput().appendField("显示时间");
            this.appendValueInput("hour").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT);
            this.appendDummyInput("").appendField(Blockly.MAKER17_HOUR);
            this.appendValueInput("minute").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT);
            this.appendDummyInput("").appendField(Blockly.MAKER17_MINUTE);
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setTooltip("");
        }
    };

    //显示-TM1637-4位数码管设置亮度
    Blockly.Blocks.ruilong_tm1637_Brightness = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput().appendField("TM1637四位数码管");
            this.appendDummyInput().appendField("设置亮度");
            this.appendValueInput('BRIGHTNESS').setCheck(Number);
            this.appendDummyInput("").appendField("%");
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setInputsInline(true);
        }
    };


    //HT16K33点阵 闪烁频率
    Blockly.Blocks.ruilong_88display_Matrix_blink_rate = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendValueInput('Blink_rate').setCheck(Number).appendField(Blockly.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE)
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setInputsInline(true);
            this.setTooltip("取值范围0/1/2/3");
        }
    };
    //HT16K33点阵 显示亮度
    Blockly.Blocks.ruilong_88display_Matrix_brightness = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendValueInput("Brightness").setCheck(Number).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_BRIGHTNESS);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setInputsInline(true);
            this.setTooltip("取值范围0~15");
        }
    };


    //HT16K33点阵 画点变量
    var ruilong_88display_DrawPixel_NUM = [
        [Blockly.Msg.MIXLY_4DIGITDISPLAY_ON, "1"],
        [Blockly.Msg.MIXLY_4DIGITDISPLAY_OFF, "0"]
    ];

    //HT16K33点阵 画点显示
    Blockly.Blocks.ruilong_88display_Matrix_POS = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendValueInput('XVALUE').setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_X + '(1-16)');
            this.appendValueInput("YVALUE").setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_Y + '(1~8)');
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT).appendField(new Blockly.FieldDropdown(ruilong_88display_DrawPixel_NUM), "DrawPixel_TYPE");
            this.setInputsInline(true);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT_TOOLTIP);
        }
    };
    //HT16K33点阵 绘制三角形显示
    Blockly.Blocks.ruilong_88display_Matrix_drawLine = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW + ' 绘制直线');

            this.appendValueInput('X0VALUE').setCheck(Number).appendField("X0");
            this.appendValueInput("Y0VALUE").setCheck(Number).appendField("Y0");
            this.appendValueInput('X1VALUE').setCheck(Number).appendField("X1");
            this.appendValueInput("Y1VALUE").setCheck(Number).appendField("Y1");

            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT).appendField(new Blockly.FieldDropdown(ruilong_88display_DrawPixel_NUM), "DrawPixel_TYPE");
            this.setInputsInline(true);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT_TOOLTIP);
        }
    };
    //HT16K33点阵 画圈显示
    Blockly.Blocks.ruilong_88display_Matrix_drawCircle = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW + ' 绘制圆形');
            this.appendDummyInput("").appendField(new Blockly.FieldDropdown([['空心', '0'], ['填充', '1']]), "drawCircle_TYPE");
            this.appendValueInput('XVALUE').setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_X);
            this.appendValueInput("YVALUE").setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_Y);
            this.appendValueInput("RVALUE").setCheck(Number).appendField("半径");
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT).appendField(new Blockly.FieldDropdown(ruilong_88display_DrawPixel_NUM), "DrawPixel_TYPE");
            this.setInputsInline(true);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT_TOOLTIP);
        }
    };

    //HT16K33点阵 画矩形显示
    Blockly.Blocks.ruilong_88display_Matrix_drawRect = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW + ' 绘制矩形');
            this.appendDummyInput("").appendField(new Blockly.FieldDropdown([['空心', '0'], ['填充', '1']]), "drawRect_TYPE");
            this.appendValueInput('XVALUE').setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_X);
            this.appendValueInput("YVALUE").setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_Y);
            this.appendValueInput('WVALUE').setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_X + '宽度');
            this.appendValueInput("HVALUE").setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_Y + '长度');
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT).appendField(new Blockly.FieldDropdown(ruilong_88display_DrawPixel_NUM), "DrawPixel_TYPE");
            this.setInputsInline(true);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT_TOOLTIP);
        }
    };

    //HT16K33点阵 绘制圆角矩形显示
    Blockly.Blocks.ruilong_88display_Matrix_drawRoundRect = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW + ' 绘制圆角矩形');
            this.appendDummyInput("").appendField(new Blockly.FieldDropdown([['空心', '0'], ['填充', '1']]), "drawRoundRect_TYPE");
            this.appendValueInput('XVALUE').setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_X);
            this.appendValueInput("YVALUE").setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_Y);
            this.appendValueInput('WVALUE').setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_X + '宽度');
            this.appendValueInput("HVALUE").setCheck(Number).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_Y + '长度');
            this.appendValueInput("RVALUE").setCheck(Number).appendField("半径");
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT).appendField(new Blockly.FieldDropdown(ruilong_88display_DrawPixel_NUM), "DrawPixel_TYPE");
            this.setInputsInline(true);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT_TOOLTIP);
        }
    };

    //HT16K33点阵 绘制三角形显示
    Blockly.Blocks.ruilong_88display_Matrix_drawTriangle = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW + ' 绘制三角形');
            this.appendDummyInput("").appendField(new Blockly.FieldDropdown([['空心', '0'], ['填充', '1']]), "drawTriangle_TYPE");
            this.appendValueInput('X0VALUE').setCheck(Number).appendField("X0");
            this.appendValueInput("Y0VALUE").setCheck(Number).appendField("Y0");
            this.appendValueInput('X1VALUE').setCheck(Number).appendField("X1");
            this.appendValueInput("Y1VALUE").setCheck(Number).appendField("Y1");
            this.appendValueInput('X2VALUE').setCheck(Number).appendField("X2");
            this.appendValueInput("Y2VALUE").setCheck(Number).appendField("Y2");
            this.appendDummyInput("").appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT).appendField(new Blockly.FieldDropdown(ruilong_88display_DrawPixel_NUM), "DrawPixel_TYPE");
            this.setInputsInline(true);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT_TOOLTIP);
        }
    };
    /*//执行器_点阵屏显示_左右对称
    var ruilong_88display_Rotation_NUM = [
    ["8*8点阵", "1"],
    ["8*16点阵", "0"],
    ];
    
    //执行器_点阵屏显示_左右对称
    Blockly.Blocks.ruilong_88display_Matrix_Rotation = {
      init: function() {
        this.setColour(Blockly.Msg['RUILONG_HUE']);
        this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
        this.appendDummyInput("").appendField("点阵屏滚动文字方向").appendField(new Blockly.FieldDropdown(ruilong_88display_Rotation_NUM), "Rotation_TYPE");
        this.setPreviousStatement(true);
        this.setNextStatement(true);
     //   this.setTooltip("");
    }
    };*/
    //执行器_HT16K33点阵显示_字符显示
    Blockly.Blocks.ruilong_88display_Matrix_TEXT = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendValueInput("TEXT", String).setCheck([Number, String]).setAlign(Blockly.ALIGN_RIGHT).appendField(" 显示字符");
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setInputsInline(true);
            //this.setTooltip("");
        }
    };
    //执行器_HT16K33点阵屏显示_显示图案
    Blockly.Blocks.ruilong_88display_Matrix_DisplayChar = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendValueInput("LEDArrayX").setAlign(Blockly.ALIGN_RIGHT).appendField('8*8' + Blockly.Msg.MIXLY_DISPLAY_MATRIX_PICARRAY);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            //this.setTooltip();
        }
    };
    //执行器_HT16K33点阵屏显示_显示图案
    Blockly.Blocks.ruilong_816display_Matrix_DisplayChar = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendValueInput("LEDArrayX").setAlign(Blockly.ALIGN_RIGHT).appendField('8*16' + Blockly.Msg.MIXLY_DISPLAY_MATRIX_PICARRAY);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            //this.setTooltip();
        }
    };


    //执行器_HT16K33点阵屏显示8*8图案数组
    Blockly.Blocks.ruilong_88display_Matrix_LedArray = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField("8*8" + Blockly.Msg.MIXLY_DISPLAY_MATRIX_ARRAYVAR).appendField(new Blockly.FieldTextInput("LedArray0808"), "VAR");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a11").appendField(new Blockly.FieldCheckbox("FALSE"), "a12").appendField(new Blockly.FieldCheckbox("FALSE"), "a13").appendField(new Blockly.FieldCheckbox("FALSE"), "a14").appendField(new Blockly.FieldCheckbox("FALSE"), "a15").appendField(new Blockly.FieldCheckbox("FALSE"), "a16").appendField(new Blockly.FieldCheckbox("FALSE"), "a17").appendField(new Blockly.FieldCheckbox("FALSE"), "a18");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a21").appendField(new Blockly.FieldCheckbox("FALSE"), "a22").appendField(new Blockly.FieldCheckbox("FALSE"), "a23").appendField(new Blockly.FieldCheckbox("FALSE"), "a24").appendField(new Blockly.FieldCheckbox("FALSE"), "a25").appendField(new Blockly.FieldCheckbox("FALSE"), "a26").appendField(new Blockly.FieldCheckbox("FALSE"), "a27").appendField(new Blockly.FieldCheckbox("FALSE"), "a28");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a31").appendField(new Blockly.FieldCheckbox("FALSE"), "a32").appendField(new Blockly.FieldCheckbox("FALSE"), "a33").appendField(new Blockly.FieldCheckbox("FALSE"), "a34").appendField(new Blockly.FieldCheckbox("FALSE"), "a35").appendField(new Blockly.FieldCheckbox("FALSE"), "a36").appendField(new Blockly.FieldCheckbox("FALSE"), "a37").appendField(new Blockly.FieldCheckbox("FALSE"), "a38");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a41").appendField(new Blockly.FieldCheckbox("FALSE"), "a42").appendField(new Blockly.FieldCheckbox("FALSE"), "a43").appendField(new Blockly.FieldCheckbox("FALSE"), "a44").appendField(new Blockly.FieldCheckbox("FALSE"), "a45").appendField(new Blockly.FieldCheckbox("FALSE"), "a46").appendField(new Blockly.FieldCheckbox("FALSE"), "a47").appendField(new Blockly.FieldCheckbox("FALSE"), "a48");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a51").appendField(new Blockly.FieldCheckbox("FALSE"), "a52").appendField(new Blockly.FieldCheckbox("FALSE"), "a53").appendField(new Blockly.FieldCheckbox("FALSE"), "a54").appendField(new Blockly.FieldCheckbox("FALSE"), "a55").appendField(new Blockly.FieldCheckbox("FALSE"), "a56").appendField(new Blockly.FieldCheckbox("FALSE"), "a57").appendField(new Blockly.FieldCheckbox("FALSE"), "a58");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a61").appendField(new Blockly.FieldCheckbox("FALSE"), "a62").appendField(new Blockly.FieldCheckbox("FALSE"), "a63").appendField(new Blockly.FieldCheckbox("FALSE"), "a64").appendField(new Blockly.FieldCheckbox("FALSE"), "a65").appendField(new Blockly.FieldCheckbox("FALSE"), "a66").appendField(new Blockly.FieldCheckbox("FALSE"), "a67").appendField(new Blockly.FieldCheckbox("FALSE"), "a68");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a71").appendField(new Blockly.FieldCheckbox("FALSE"), "a72").appendField(new Blockly.FieldCheckbox("FALSE"), "a73").appendField(new Blockly.FieldCheckbox("FALSE"), "a74").appendField(new Blockly.FieldCheckbox("FALSE"), "a75").appendField(new Blockly.FieldCheckbox("FALSE"), "a76").appendField(new Blockly.FieldCheckbox("FALSE"), "a77").appendField(new Blockly.FieldCheckbox("FALSE"), "a78");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a81").appendField(new Blockly.FieldCheckbox("FALSE"), "a82").appendField(new Blockly.FieldCheckbox("FALSE"), "a83").appendField(new Blockly.FieldCheckbox("FALSE"), "a84").appendField(new Blockly.FieldCheckbox("FALSE"), "a85").appendField(new Blockly.FieldCheckbox("FALSE"), "a86").appendField(new Blockly.FieldCheckbox("FALSE"), "a87").appendField(new Blockly.FieldCheckbox("FALSE"), "a88");

            this.setOutput(true, Number);
            //this.setTooltip();
        }
    };

    //执行器_HT16K33点阵屏显示8*16图案数组
    Blockly.Blocks.ruilong_816display_Matrix_LedArray = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField("8*16" + Blockly.Msg.MIXLY_DISPLAY_MATRIX_ARRAYVAR).appendField(new Blockly.FieldTextInput("LedArray0816"), "VAR");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a11").appendField(new Blockly.FieldCheckbox("FALSE"), "a12").appendField(new Blockly.FieldCheckbox("FALSE"), "a13").appendField(new Blockly.FieldCheckbox("FALSE"), "a14").appendField(new Blockly.FieldCheckbox("FALSE"), "a15").appendField(new Blockly.FieldCheckbox("FALSE"), "a16").appendField(new Blockly.FieldCheckbox("FALSE"), "a17").appendField(new Blockly.FieldCheckbox("FALSE"), "a18").appendField(new Blockly.FieldCheckbox("FALSE"), "a19").appendField(new Blockly.FieldCheckbox("FALSE"), "a110").appendField(new Blockly.FieldCheckbox("FALSE"), "a111").appendField(new Blockly.FieldCheckbox("FALSE"), "a112").appendField(new Blockly.FieldCheckbox("FALSE"), "a113").appendField(new Blockly.FieldCheckbox("FALSE"), "a114").appendField(new Blockly.FieldCheckbox("FALSE"), "a115").appendField(new Blockly.FieldCheckbox("FALSE"), "a116");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a21").appendField(new Blockly.FieldCheckbox("FALSE"), "a22").appendField(new Blockly.FieldCheckbox("FALSE"), "a23").appendField(new Blockly.FieldCheckbox("FALSE"), "a24").appendField(new Blockly.FieldCheckbox("FALSE"), "a25").appendField(new Blockly.FieldCheckbox("FALSE"), "a26").appendField(new Blockly.FieldCheckbox("FALSE"), "a27").appendField(new Blockly.FieldCheckbox("FALSE"), "a28").appendField(new Blockly.FieldCheckbox("FALSE"), "a29").appendField(new Blockly.FieldCheckbox("FALSE"), "a210").appendField(new Blockly.FieldCheckbox("FALSE"), "a211").appendField(new Blockly.FieldCheckbox("FALSE"), "a212").appendField(new Blockly.FieldCheckbox("FALSE"), "a213").appendField(new Blockly.FieldCheckbox("FALSE"), "a214").appendField(new Blockly.FieldCheckbox("FALSE"), "a215").appendField(new Blockly.FieldCheckbox("FALSE"), "a216");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a31").appendField(new Blockly.FieldCheckbox("FALSE"), "a32").appendField(new Blockly.FieldCheckbox("FALSE"), "a33").appendField(new Blockly.FieldCheckbox("FALSE"), "a34").appendField(new Blockly.FieldCheckbox("FALSE"), "a35").appendField(new Blockly.FieldCheckbox("FALSE"), "a36").appendField(new Blockly.FieldCheckbox("FALSE"), "a37").appendField(new Blockly.FieldCheckbox("FALSE"), "a38").appendField(new Blockly.FieldCheckbox("FALSE"), "a39").appendField(new Blockly.FieldCheckbox("FALSE"), "a310").appendField(new Blockly.FieldCheckbox("FALSE"), "a311").appendField(new Blockly.FieldCheckbox("FALSE"), "a312").appendField(new Blockly.FieldCheckbox("FALSE"), "a313").appendField(new Blockly.FieldCheckbox("FALSE"), "a314").appendField(new Blockly.FieldCheckbox("FALSE"), "a315").appendField(new Blockly.FieldCheckbox("FALSE"), "a316");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a41").appendField(new Blockly.FieldCheckbox("FALSE"), "a42").appendField(new Blockly.FieldCheckbox("FALSE"), "a43").appendField(new Blockly.FieldCheckbox("FALSE"), "a44").appendField(new Blockly.FieldCheckbox("FALSE"), "a45").appendField(new Blockly.FieldCheckbox("FALSE"), "a46").appendField(new Blockly.FieldCheckbox("FALSE"), "a47").appendField(new Blockly.FieldCheckbox("FALSE"), "a48").appendField(new Blockly.FieldCheckbox("FALSE"), "a49").appendField(new Blockly.FieldCheckbox("FALSE"), "a410").appendField(new Blockly.FieldCheckbox("FALSE"), "a411").appendField(new Blockly.FieldCheckbox("FALSE"), "a412").appendField(new Blockly.FieldCheckbox("FALSE"), "a413").appendField(new Blockly.FieldCheckbox("FALSE"), "a414").appendField(new Blockly.FieldCheckbox("FALSE"), "a415").appendField(new Blockly.FieldCheckbox("FALSE"), "a416");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a51").appendField(new Blockly.FieldCheckbox("FALSE"), "a52").appendField(new Blockly.FieldCheckbox("FALSE"), "a53").appendField(new Blockly.FieldCheckbox("FALSE"), "a54").appendField(new Blockly.FieldCheckbox("FALSE"), "a55").appendField(new Blockly.FieldCheckbox("FALSE"), "a56").appendField(new Blockly.FieldCheckbox("FALSE"), "a57").appendField(new Blockly.FieldCheckbox("FALSE"), "a58").appendField(new Blockly.FieldCheckbox("FALSE"), "a59").appendField(new Blockly.FieldCheckbox("FALSE"), "a510").appendField(new Blockly.FieldCheckbox("FALSE"), "a511").appendField(new Blockly.FieldCheckbox("FALSE"), "a512").appendField(new Blockly.FieldCheckbox("FALSE"), "a513").appendField(new Blockly.FieldCheckbox("FALSE"), "a514").appendField(new Blockly.FieldCheckbox("FALSE"), "a515").appendField(new Blockly.FieldCheckbox("FALSE"), "a516");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a61").appendField(new Blockly.FieldCheckbox("FALSE"), "a62").appendField(new Blockly.FieldCheckbox("FALSE"), "a63").appendField(new Blockly.FieldCheckbox("FALSE"), "a64").appendField(new Blockly.FieldCheckbox("FALSE"), "a65").appendField(new Blockly.FieldCheckbox("FALSE"), "a66").appendField(new Blockly.FieldCheckbox("FALSE"), "a67").appendField(new Blockly.FieldCheckbox("FALSE"), "a68").appendField(new Blockly.FieldCheckbox("FALSE"), "a69").appendField(new Blockly.FieldCheckbox("FALSE"), "a610").appendField(new Blockly.FieldCheckbox("FALSE"), "a611").appendField(new Blockly.FieldCheckbox("FALSE"), "a612").appendField(new Blockly.FieldCheckbox("FALSE"), "a613").appendField(new Blockly.FieldCheckbox("FALSE"), "a614").appendField(new Blockly.FieldCheckbox("FALSE"), "a615").appendField(new Blockly.FieldCheckbox("FALSE"), "a616");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a71").appendField(new Blockly.FieldCheckbox("FALSE"), "a72").appendField(new Blockly.FieldCheckbox("FALSE"), "a73").appendField(new Blockly.FieldCheckbox("FALSE"), "a74").appendField(new Blockly.FieldCheckbox("FALSE"), "a75").appendField(new Blockly.FieldCheckbox("FALSE"), "a76").appendField(new Blockly.FieldCheckbox("FALSE"), "a77").appendField(new Blockly.FieldCheckbox("FALSE"), "a78").appendField(new Blockly.FieldCheckbox("FALSE"), "a79").appendField(new Blockly.FieldCheckbox("FALSE"), "a710").appendField(new Blockly.FieldCheckbox("FALSE"), "a711").appendField(new Blockly.FieldCheckbox("FALSE"), "a712").appendField(new Blockly.FieldCheckbox("FALSE"), "a713").appendField(new Blockly.FieldCheckbox("FALSE"), "a714").appendField(new Blockly.FieldCheckbox("FALSE"), "a715").appendField(new Blockly.FieldCheckbox("FALSE"), "a716");
            this.appendDummyInput("").appendField(new Blockly.FieldCheckbox("FALSE"), "a81").appendField(new Blockly.FieldCheckbox("FALSE"), "a82").appendField(new Blockly.FieldCheckbox("FALSE"), "a83").appendField(new Blockly.FieldCheckbox("FALSE"), "a84").appendField(new Blockly.FieldCheckbox("FALSE"), "a85").appendField(new Blockly.FieldCheckbox("FALSE"), "a86").appendField(new Blockly.FieldCheckbox("FALSE"), "a87").appendField(new Blockly.FieldCheckbox("FALSE"), "a88").appendField(new Blockly.FieldCheckbox("FALSE"), "a89").appendField(new Blockly.FieldCheckbox("FALSE"), "a810").appendField(new Blockly.FieldCheckbox("FALSE"), "a811").appendField(new Blockly.FieldCheckbox("FALSE"), "a812").appendField(new Blockly.FieldCheckbox("FALSE"), "a813").appendField(new Blockly.FieldCheckbox("FALSE"), "a814").appendField(new Blockly.FieldCheckbox("FALSE"), "a815").appendField(new Blockly.FieldCheckbox("FALSE"), "a816");
            this.setOutput(true, Number);
            this.setTooltip();

        }
    };

    //执行器_点阵屏显示_清除屏幕
    Blockly.Blocks.ruilong_88display_Matrix_CLEAR = {
        init: function () {
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.appendDummyInput("").appendField(new Blockly.FieldTextInput('myMatrix'), 'matrixName').appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOW);
            this.appendDummyInput("").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_CLEAR);
            this.setPreviousStatement(true);
            this.setNextStatement(true);
            this.setTooltip();
        }
    };
    //显示预设图案
    Blockly.Blocks.ruilong_88display_Matrix_Ledimg = {
        init: function () {
            this.appendDummyInput("").appendField("8*8点阵预设图案").appendField(new Blockly.FieldDropdown([
                ["↑", "183c7edb18181818"],
                ["↓", "18181818db7e3c18"],
                ["←", "103060ffff603010"],
                ["→", "080c06ffff060c08"],
                ["♥", "42ffffffff7e3c18"],
                ["▲", "183c7eff00000000"],
                ["▼", "00000000ff7e3c18"],
                ["◄", "103070f0f0703010"],
                ["►", "080c0e0f0f0e0c08"],
                ["△", "182442ff00000000"],
                ["▽", "00000000ff422418"],
                ["☺", "3c42a581a599423c"],
                ["○", "3c4281818181423c"],
                ["◑", "3c4e8f8f8f8f4e3c"],
                ["◐", "3c72f1f1f1f1723c"],
                ["￥", "4224ff08ff080808"],
                ["Χ", "8142241818244281"],
                ["✓", "0000010204885020"],
                ["□", "007e424242427e00"],
                ["▣", "007e425a5a427e00"],
                ["◇", "1824428181422418"],
                ["♀", "3844444438107c10"],
                ["♂", "0f030579d888d870"],
                ["♪", "0c0e0b080878f860"],
                ["✈", "203098ffff983020"],
                ["︱", "1010101010101010"],
                ["—", "000000ff00000000"],
                ["╱", "0102040810204080"],
                ["＼", "8040201008040201"],
                ["大", "1010fe1010284482"],
                ["中", "1010fe9292fe1010"],
                ["小", "1010105454921070"],
                ["米", "00925438fe385492"],
                ["正", "00fe10105e5050ff"],
                ["囧", "ffa5a5c3bda5a5ff"]
            ]), "img_");
            this.setOutput(true);
            this.setTooltip('');
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.setHelpUrl('');
        }
    };

    Blockly.Blocks.ruilong_816display_Matrix_Ledimg = {
        init: function () {
            this.appendDummyInput("").appendField("8*16点阵预设图案").appendField(new Blockly.FieldDropdown([
                ["❤", "0100038007c00fe01ff01ff00ee00640"],
                ["♥", "00000100038007c00fe00ee004400000"],
                ["▲", "00003ffc1ff80ff007e003c001800000"],
                ["▼", "0000018003c007e00ff01ff83ffc0000"],
                ["◄", "100030007000f000f000700030001000"],
                ["►", "0008000c000e000f000f000e000c0008"],
                ["↑", "01800180018009900db007e003c00180"],
                ["↓", "018003c007e00db00990018001800180"],
                ["←", "180030006000ff00ff00600030001800"],
                ["→", "0018000c000600ff00ff0006000c0018"],
                ["☺", "000003c004200000000022441c380000"],
                ["☹", "0000042003c0000000001c3822440000"],
                ["♀♂", "10707cd8108838d8447944054403380f"],
                ["♪♪", "6060f8f87878080808080b0b0e0e0c0c"],
                ["囧", "0ff00a500a500bd00c300a500a500ff0"]
            ]), "img_");
            this.setOutput(true);
            this.setTooltip('');
            this.setColour(Blockly.Msg['RUILONG_HUE']);
            this.setHelpUrl('');
        }
    };

  })();